lazygalaxyfandomcom-20200214-history
Ship Mod Creation
To create a ship mod, you'll need to do the following things: First, create an XML file with the ship description. The file should be created inside my_custom_mod/ships/player folder. XML is a text markup format which the game can process. Name the file shipname.xml. The basic ship XML looks like this: 0 Red Rhino fighter 125 2 2 240 30 2000 1.045 8000 1.05 100 1.075 3 composite 8 ballistic 1 3 6 0.5 750 10 -2 2 True 45 120 8 ballistic 1 3 6 0.5 750 10 -15 2 True 45 120 8 ballistic 1 3 6 0.5 750 -10 -2 2 True 315 120 8 ballistic 1 3 6 0.5 750 -10 -15 2 True 315 120 redrhino1.png redrhino2.png redrhino3.png redrhino4.png redrhino5.png Basic Parameters It looks much bigger than item mod, but don't be intimidated :) We'll go through ship parameters one by one: * hull - hull type identifier. For now: always leave as zero * name '- ship name * '''type '- ship type. used to determine AI behavior (and there's a chance it will happen later on again), so use '''battleship for bigger ships and fighter for smaller ships * bbox - bounding box. Somewhat tricky now. Additional parameters: x '''and '''y '''parameters indicate bounding box shift according to '''sprite center. Can be negative. So if your ship is perfectly centered on sprite - leave as zero. in case of red rhino: the ship itself is moved to the right (a bit) due to huge flames. Therefore the bounding box is located 18 pixels to the right of the center. w '''and '''h indicate bounding box width and height * base_hp - hp on first level * hp_increase_per_level - how much hp is increased on every level * hp_per_25_levels_multiplier - how much hp is multiplied every 25 levels. i.e. level 25 hp will be (base_hp + hp_increase_per_level * current_level) * hp_per_25_levels_multiplier * base_fuel_cost - ship fuel cost on first level * fuel_cost_multiplier - 'by how much does the fuel cost increases on every level (i.e. level 2 ship will be base_fuel_cost * fuel_cost_multiplier ^ 2) * '''base_metal_cost ' - ship metal cost on first level * 'metal_cost_multiplier - '''by how much does the metal cost grows on every level (similar to fuel formula) * '''base_upgrade_cost ' - how much exp does upgrade cost on the first level * '''upgrade_cost_multiplier - by how much does upgrade cost increases on every next level * crew '- specimen cost of the ship * '''armor '- armor type of the ship. can be '''composite, energy, kinetic, generic * sprites - list of ship sprites, each written under own tag sprite. Those are played one after another. Ship Weapons After that, there is the list of different weapons that ships have. Don't make more than 8 weapons. All weapons are located under tag. There are three weapon types at the moment. 1) Normal projectile weapon. Example: 10 heat 0.5 4 1 4 0.1 3 1500 0 14 1 Parameters: * base_dmg - 'base weapon damage on level 0 ship * '''type '- weapon type. determines the damage versus different weapon types. can be '''energy, proton, plasma, heat, ballistic, acidic, chaotic * dmg_increase_per_level - how much damage per level grows * dmg_per_25_levels_multiplier '- by how much the damage is multiplied every 25 levels * '''reload_time '- how quickly the weapon reloads * 'spread_angle '- the angle at which bullets can fly from the weapon (bigger angle = less accuracy) * 'shot_interval '- the time between shots * '''clip_size - how many bullets can weapon fire before it needs to reload * projectile_speed - how fast is the bullet. battlefield width = 1920, therefore projectile_speed of 1500 would mean that the bullet traverses ~3/4 of the screen per second * x, y - the location of weapons relative to the ship sprite (0,0) is the center * bullet_anim - from 0 to 7. determines how the bullet looks (see gallery below) bullet0.png|Bullet 0 bullet1.png|Bullet 1 Bullet31.png|Bullet 2 Bullet41.png|Bullet 3 Bullet51.png|Bullet 4 Bullet5.png|Bullet 5 Bullet6.png|Bullet 6 Bullet7.png|Bullet 7 Bullet91.png|Bullet 8 Bullet9.png|Bullet 9 2) A laser weapon that shoots continuous ray, heating and then damaging the enemy. Example: 4 proton 0.4 5 2 1 42 -22 0 Parameters: * base_dmg - 'base weapon damage on level 0 ship * '''type '- weapon type. determines the damage versus different weapon types. can be '''energy, proton, plasma, heat, ballistic, acidic, chaotic * dmg_increase_per_level - how much damage per level grows * dmg_per_25_levels_multiplier '- by how much the damage is multiplied every 25 levels * '''reload_time '- how quickly the weapon reloads * 'fire_time '- how long is the laser beam firing before damaging the enemy * '''x, y - the location of weapons relative to the ship sprite (0,0) is the center * color - color of the laser. number from a preset list of colors [0-6]. default is 0 3) Flying rocket weapon. Can be homing. Usually quite slow to turn. Example: 10 ballistic 2 4 6 0.5 750 15 10 2 True 45 120 Parameters: * base_dmg - 'base weapon damage on level 0 ship * '''type '- weapon type. determines the damage versus different weapon types. can be '''energy, proton, plasma, heat, ballistic, acidic, chaotic * dmg_increase_per_level - how much damage per level grows * dmg_per_25_levels_multiplier '- by how much the damage is multiplied every 25 levels * '''reload_time '- how quickly the weapon reloads * '''projectile_speed - how fast is the bullet. battlefield width = 1920, therefore projectile_speed of 1500 would mean that the bullet traverses ~3/4 of the screen per second * speed_up_time '''- torpedos start at zero speed. This parameter sets how quickly the rocket speeds up from 0 to projectile_speed * '''homing- is torpedo homing or will it fly directly, disregarding enemy position change? can be true or false * base_angle - the base angle at which the weapon is fired (relative to current ship turn angle) * projectile_rotation_speed - how quick will homing torpedo turn (degrees / second) * x, y - the location of weapons relative to the ship sprite (0,0) is the center * bullet_anim - from 0 to 3. determines how the rocket looks (see gallery below) enemyRocket1.png|Rocket (Torpedo) 0 rocket1.png|Rocket (Torpedo) 1 minirocket2.png|Rocket (Torpedo) 2 enemyminirocket1.png|Rocket (Torpedo) 3 Ship Abilities Each ship can have up to 2 abilities. Those are listed under tag. Each ability tag has the following parameters: * type - ability type, listed below * unlock_level - at which level will this ability become available * cooldown - ability cooldown (in seconds) In addition to that, each ability has its own separate parameters List of current abilities and their parameters: 2) Put the ship sprites into the sprites folder For ships to be displayed in the game properly, you need to put their images into sprites folder of your mod folder. For the previous item, there would be five sprites, their paths: * my_sample_mod/sprites/redrhino1.png * my_sample_mod/sprites/redrhino2.png * my_sample_mod/sprites/redrhino3.png * my_sample_mod/sprites/redrhino4.png * my_sample_mod/sprites/redrhino5.png The image should be in png format, any size you want. They should be facing right (zero degrees) The screen is 1920x1080, you can put any sprite according to the size that you want it to take on the screen. Rhino is about 78x80 (For reference) After that - you can go back to Modding Guide to verify/upload/enable your mod. You can also download the sample ship mod here: red rhino sample mod